package Generic;

/**
 * @Author czl
 * @Date 2024-03-29
 */
public class MainTest {
    public static void main(String[] args) {
        GenericClass<String> stringGenericClass = new GenericClass<>();

        String[] strProduct ={"苹果手机","遥遥领先","咖啡机","扫地机器人"};

        for (String s : strProduct) {
            stringGenericClass.addProduct(s);
        }

        String product = stringGenericClass.getProduct();

        System.out.println("恭喜你,抽中了：" + product);

        System.out.println("------------------------------------------");


        GenericClass<Integer> integerGenericClass = new GenericClass<>();
        int[] intProduct={1000,8888,10000,99999};

        for (int i : intProduct) {
            integerGenericClass.addProduct(i);
        }

        Integer product1 = integerGenericClass.getProduct();

        System.out.println("恭喜你,抽中了奖金：" + product1 + "元");
    }
}
